package JavaBase;
/*
定义驾驶员类(Driver),有姓名(name)、身高(height)，体重(weight)，驾龄(driveOfAge)，驾照号(driveNo)等属性，
可以开汽车。
 */
public class Driver {
    private String name;
    private double height;
    private double weight;
    private double driveOfAge;
    private int driveNo;
    public Driver()
    {
        this.name="无名";
        this.height=1.7;
        this.weight=154;
        this.driveOfAge=3;
        this.driveNo=123456;
    }
    public void driverShow()
    {
        System.out.println("***驾驶员信息***");
        System.out.println("姓名："+this.name);
        System.out.println("身高："+this.height);
        System.out.println("体重："+this.weight);
        System.out.println("驾龄："+this.driveOfAge);
        System.out.println("驾驶证号："+this.driveNo);
    }
    public Driver(String name,double height,double weight,double driveOfAge,int driveNo)
    {
        this.driveNo=driveNo;
        this.name=name;
        this.height=height;
        this.weight=weight;
        this.driveOfAge=driveOfAge;

    }
    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getWeight() {
        return weight;
    }

    public double getDriveOfAge() {
        return driveOfAge;
    }

    public double getHeight() {
        return height;
    }

    public int getDriveNo() {
        return driveNo;
    }

    public void setDriveNo(int driveNo) {
        this.driveNo = driveNo;
    }

    public void setDriveOfAge(double driveOfAge) {
        this.driveOfAge = driveOfAge;
    }

    public void setHeight(double height) {
        this.height = height;
    }
    Car car;
    public void driverCar(Car car)
    {
        driverShow();
        car.start();
        System.out.println(this.name+"驾驶着"+car.getBrand()+"汽车");
        car.carShow();
        car.run();
        car.speedUp();
        car.run();
        car.whistle();
        car.run();
        car.brake();
        car.time1s();
        car.stop();
    }
}
